fix(tui): truncate question tab headers to terminal width - #279
Merged
Conversation
fix(tool): require plain-object parameter roots per OpenAI tools contract
release: msgid wrap fix, workflow draft action, DAG execution-location ownership
release: session-following location stamps, adoption fencing, app id alignment
release: current-revision DAG view + node-output file refs
release: README rework — graph guide, features, usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
QA (question tool) 选择界面的 TAB 头部直接渲染
{q.header},无宽度限制。schema 中 header 的 "max 30 chars" 仅为描述性提示不强制,当模型传入长中文 header 时(如 session 产品设计完善:下一步选择流程),每个 tab 按内容自适应撑开成"长条",多个长 tab 超出终端宽后折行,无法保持紧凑 TAB 页布局。Fix
packages/tui/src/routes/session/question.tsx:truncateWidth():基于Bun.stringWidth的显示宽度感知截断(CJK/emoji 安全)headerBudgetmemo:按终端宽度与 tab 数分配每个 tab 的显示列预算,clamp 到 [6, 24]truncateWidth(q.header, headerBudget())Verification
bun typecheck(packages/tui) 通过bun test test/index.test.tsx test/keymap.test.tsx4/4 通过